<template>
  <div class="group-container">
    <el-form-item label="产品主图：" prop="pictures" :rules="$rule.required">
      <el-upload
        action="/api/Common/upload"
        list-type="picture-card"
        :http-request="$.user.upload"
        :file-list="licenses"
      >
        <i class="el-icon-plus"></i>
      </el-upload>
    </el-form-item>

    <el-form-item label="产品标题：" prop="title" :rules="$rule.required">
      <el-input placeholder="请输入产品标题" v-model="pageData.title" clearable></el-input>
    </el-form-item>
    <el-form-item label="产品卖点：" prop="selling_point" :rules="$rule.required">
      <el-input placeholder="请输入产品卖点" v-model="pageData.selling_point" clearable></el-input>
    </el-form-item>
    <el-form-item label="标签：" prop="tag_ids" :rules="$rule.required">
      <el-select v-model="pageData.tag_ids" multiple placeholder="请选择产品标签">
        <el-option v-for="item in tag_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="前台类目：" prop="category_ids">
      <el-select v-model="pageData.category_ids" multiple placeholder="请选择前台类目">
        <el-option
          v-for="item in category_list"
          :key="item.id"
          :label="item._name"
          :value="item.id"
          :disabled="item.is_child == 1 ? false : true"
        ></el-option>
      </el-select>
    </el-form-item>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    // // 权限编码
    pageData: {
      type: Object,
      // required: true,
    },
    tag_list: {
      type: Object,
      // required: true,
    },
    category_list: {
      type: Object,
      // required: true,
    },

    // noShowUser: {
    //   type: Boolean,
    // },
  },
  data() {
    return {
      loading: false,

      // pagedata: {},
      licenses: [],
    }
  },
  watch: {
    pageData(val, oldval) {
      console.log(val)
      this.pageData = val
    },
  },
  mounted: function () {
    console.log(this.pageData)
    console.log(this.tag_list)
    console.log(this.category_list)

    // let that = this;
    // // this.column = this.$route.query.column;
    // // this.init();
    // that.$util.autoHeight(that, that.$refs.table.$el, 1);
    // that.handleRequest();
  },
  computed: {},
  methods: {},
}
</script>

<style scoped>
.main_contain {
  padding: 12px 20px;
}

.container > .row {
  padding: 12px 0;
  border-bottom: 1px solid #ccc;
}

.row-aside {
  margin-left: 30px;
}

.el-main {
  padding: 0 12px 0 0;
}

.txt {
  display: inline-block;
  margin-right: 12px;
  line-height: 25px;
}

.row1 {
  font-size: 14px;
  color: #000;
  margin-bottom: 12px;
}

.txt2 {
  font-size: 13px;
  color: #333;
}
</style>
